package hit.example.net;

import java.io.File;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Environment;
import android.util.Log;

import com.telpoo.frame.utils.FileSupport;
import com.telpoo.frame.utils.Mlog;

public class DownloadListenerService extends BroadcastReceiver {

	@Override
	public void onReceive(Context context, Intent intent) {
		Log.e("naq", "date");
		
		boolean status = FileSupport.unpackZip(
				Environment.getExternalStorageDirectory() + "/Hit_Dict/db/",
				"anh_viet.zip");
		
		File file = new File(Environment.getExternalStorageDirectory()
				+ "/Hit_Dict/db/", "anh_viet.zip");
		boolean deleted = file.delete();

		Intent i = new Intent();
		i.setClassName("hit.example.hitdict",
				"hit.example.home.HomeActivity");
		i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
		context.startActivity(i);

	}
}
